/**
 * @file jsasmconfig.h
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2024-03-30
 * 
 * @copyright Copyright (c) 2024
 * 
 */
#ifndef __JSASM_CONFIG_H__
#define __JSASM_CONFIG_H__
#include <type_traits>

#if JSASM_HAS_CPP_ATTRIBUTE_NODISCARD
#define JSASM_NODISCARD [[nodiscard]]
#else
#define JSASM_NODISCARD /* NOT SUPPORTED */
#endif

#if !defined(DEBUG) && JSASM_HAS_ATTRIBUTE_ALWAYS_INLINE
#define JSASM_INLINE inline __attribute__((always_inline))
#elif !defined(DEBUG) && JSASM_HAS__FORCEINLINE
#define JSASM_INLINE __forceinline
#else
#define JSASM_INLINE inline
#endif

#if JSASM_HAS_BUILTIN_EXPECT
#define JSASM_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
#define JSASM_LIKELY(condition) (__builtin_expect(!!(condition), 1))
#else
#define JSASM_UNLIKELY(condition) (condition)
#define JSASM_LIKELY(condition) (condition)
#endif

#endif // __JSASM_CONFIG_H__